<template>
  <div id="app">
	  <el-header>vue示例</el-header>
	  <el-container>
		  <el-aside>
			  <el-col>
				  <el-menu v-for="(link,index) in linkDatas" key="index">
					<el-menu-item v-bind:index="index+1" @click="goPage(link.path)">
					  <i class="el-icon-menu"></i>
					  <span slot="title">{{link.name}}--{{index}}</span>
					</el-menu-item>
				  </el-menu>
			  </el-col>
		  </el-aside>
		  <el-main>
			  <router-view/>
		  </el-main>
			  
	  </el-container>
  </div>
</template>

<script>
	import store from './vuex/store.js';
	function linkData(path,name){
		  this.path = path;
		  this.name = name;
	}
export default {
  name: 'app',
  store,
  data() {
  	return {
  		key: 'value',
		linkDatas:[
			new linkData("/","首页"),
			new linkData('/axios','axios获取数据'),
			new linkData('/cz1/main','父子组件传值'),
			new linkData('/cz/main','非父子组件传值'),
			new linkData('/params/index','动态传值 和 get参数传值测试'),
			new linkData('/nav','编程式导航'),
			new linkData('/account','路由嵌套'),
			new linkData('/el','ElementUI')
			// new linkData('','')
		]
  	}
	
  },
  methods: {
	  goPage:function(data){
		 this.$router.push({path:data})
	  },
  	handleOpen(key, keyPath) {
		console.log(key, keyPath);
	  },
	  handleClose(key, keyPath) {
		console.log(key, keyPath);
	  }
  },
}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;  
}

  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
li{
	text-align: left;
	// font-size: 20px;
	// list-style-type: none;
}
</style>
